<?php
include_once __DIR__.'/vendor/autoload.php';

$database = [
    'driver' => 'mysql',
    'host' => 'localhost',
    'database' => 'shangming',
    'username' => 'root',
    'password' => 'root',
    'charset' => 'utf8',
//    'collation' => 'utf8_unicode_ci',
];
use Illuminate\Database\Capsule\Manager as Capsule;
$capsule = new Capsule;
//创建一个数据库的链接
$capsule->addConnection($database);
//静态可访问
$capsule->setAsGlobal();
//启动Eloquent，实际上就是解析链接信息，开始建立数据库的链接
$capsule->bootEloquent();